package com.design.chain;

public abstract class AbstractLogger implements Logger{
    protected int level;

    protected AbstractLogger nextLogger;

    public void setNextLogger(AbstractLogger nextLogger){
        this.nextLogger = nextLogger;
    }

    public void logMessage(int level,String message){
        if(this.level <= level){
            write(message);
        }

        if(this.nextLogger != null){
            nextLogger.logMessage(level,message);
        }
    }

//    @Override
//    public void write(){
//
//    };
}
